package com.practice.time;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
import java.util.TimeZone;


public final class DateTimePractice {
	
	private static final Locale LOCALE;
	
	static {
		LOCALE = Locale.getDefault();
	}
	
	public static void run() {
		Date date = new Date();
		DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", LOCALE);
		System.out.println(dateFormat.format(date));
		
		dateFormat.setTimeZone(TimeZone.getTimeZone("GMT-05:00"));
		System.out.println(dateFormat.format(date));
		
		dateFormat.setTimeZone(TimeZone.getTimeZone("America/New_York"));
		System.out.println(dateFormat.format(date));
		
		dateFormat.setTimeZone(TimeZone.getTimeZone("GMT+09:00"));
		System.out.println(dateFormat.format(date));
		
		dateFormat.setTimeZone(TimeZone.getTimeZone("Japan"));
		System.out.println(dateFormat.format(date));
		
		dateFormat.setTimeZone(TimeZone.getTimeZone("GMT+08:00"));
		System.out.println(dateFormat.format(date));
		
		dateFormat.setTimeZone(TimeZone.getTimeZone("Asia/Beijing"));
		System.out.println(dateFormat.format(date));
		
		dateFormat.setTimeZone(TimeZone.getTimeZone("Asia/Shanghai"));
		System.out.println(dateFormat.format(date));
	}
}
